class AxisType:
    (Linear, Rotary) = range(2)

def getAxisType(axisType):
    if axisType == "linear": return AxisType.Linear
    elif axisType == "rotary": return AxisType.Rotary

def getAxisTypeStr(axisType):
    if axisType == AxisType.Linear: return "linear"
    elif axisType == AxisType.Rotary: return "rotary"


class LinearAxis:
    def __init__(self, maxVelocity, minTravel, maxTravel):
        self.maxVelocity = maxVelocity
        self.maxTravel = maxTravel
        self.minTravel = minTravel

    def getMaxVelocity(self): return self.maxVelocity
    def setMaxVelocity(self, maxVelocity): self.maxVelocity = maxVelocity

    def getMaxTravel(self): return self.maxTravel
    def setMaxTravel(self, maxTravel): self.maxTravel = maxTravel

    def getMinTravel(self): return self.minTravel
    def setMinTravel(self, minTravel): self.minTravel = minTravel

class RotaryAxis:
    def __init__(self, maxVelocity, minTravel, maxTravel, assignment, location, xpos, ypos, zpos):
        self.maxVelocity = maxVelocity
        self.minTravel = minTravel
        self.maxTravel = maxTravel
        self.assignment = assignment
        self.location = location
        self.xpos = xpos
        self.ypos = ypos
        self.zpos = zpos

    def getMaxVelocity(self): return self.maxVelocity
    def setMaxVelocity(self, maxVelocity): self.maxVelocity = maxVelocity

    def getMaxTravel(self): return self.maxTravel
    def setMaxTravel(self, maxTravel): self.maxTravel = maxTravel

    def getMinTravel(self): return self.minTravel
    def setMinTravel(self, minTravel): self.minTravel = minTravel

    def getAssignment(self): return self.assignment
    def setAssignment(self, assignment): self.assignment = assignment

    def getLocation(self): return self.location
    def setLocation(self, location): self.location = location

    def getPosition(self): return [self.xpos, self.ypos, self.zpos]
    def setPosition(self, xpos, ypos, zpos):
        self.xpos = xpos
        self.ypos = ypos
        self.zpos = zpos
